home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10234 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  66 lines

  1. Path: cs.stir.ac.uk!gjn
  2. From: gjn@cs.stir.ac.uk (Gary J Nugent (MSc/SE))
  3. Newsgroups: comp.lang.c++
  4. Subject: DLL Creation Problem with VC++2.0
  5. Date: 7 Mar 1996 10:17:17 GMT
  6. Organization: Computing Science and Mathematics, Stirling University
  7. Distribution: world
  8. Message-ID: <4hmd3d$pt4@lorne.stir.ac.uk>
  9. NNTP-Posting-Host: gjn@shilling.cs.stir.ac.uk
  10.  
  11. Hello 
  12.  
  13. I have a problem getting a DLL to compile and link from the command line with
  14. VC++2.0.
  15.  
  16. I'm actually tring to create a simple DLL which I can call from a Java
  17. application.  This is a test DLL which will just print a string.  The Java code
  18. is OK and there are two C files. One created by Java as a stub file HelloWorld.c,
  19. and the other created in VC++2.0 HelloWorldImp.c as follows :-
  20.  
  21.  
  22. #include <StubPreamble.h>
  23. #include <stdio.h>
  24. #include "HelloWorld.h"
  25.  
  26. void HelloWorld_displayHelloWorld(struct HHelloWorld *this) {
  27. printf("Hello World!\n");
  28. return;
  29. }
  30.  
  31. I'm running Win NT 3.51, here are the relevant settings :-
  32.  
  33. INCLUDE=e:\java\include;e:\java\include\win32;e:\msvc20\include;
  34. LIB=e:\msvc20\lib;e:\java\lib;%LIB%
  35.  
  36.  
  37. I then issue the following command for cl :-
  38.  
  39. cl HelloWorld.c HelloWorldImp.c -FeHello.dll -MD -LD javai.lib
  40.  
  41.  
  42. Both source files are in the current directory and it finds the relevant headers
  43. associated with them and starts to compile HelloWorld.c.  It then starts printing
  44. a multitude of identical errors related to several .h files.  Two that I saw were
  45. objbase.h and ole2.h, and it complains that _export is an obsolete keyword over
  46. and over again.  It does the same thing when it gets to HelloWorldImp.c.
  47.  
  48.  
  49. Is there some VC environment variable not set correctly, as I don't think it's a
  50. problem with the source files.
  51.  
  52. Any ideas or help would be greatly appreciated
  53.  
  54.  
  55. Please respond by e-mail 
  56.  
  57. Cheers
  58.  
  59. Gary Nugent
  60.  
  61. gjn@cs.stir.ac.uk
  62. http://pc19.cs.stir.ac.uk/gjn.html
  63.  
  64.  
  65.  
  66.